import java.math.BigInteger;

public class GetWheat {
    private static class HugeNum {
        private int[] num = new int[2048];
        int size;

        public int getNum(int i) {
            return num[i];
        }

        public boolean isEmpty() {
            return size == 0;
        }

        public void setOne(int i) {
            num[0] = 1;
            size ++;
        }

        public void add(HugeNum hugeNum) {
            int lastR = 0;
            for (int i = 0; i < hugeNum.size; i++) {
                int sum = num[i] + hugeNum.getNum(i) + lastR;
                num[i] = sum % 10;
                lastR = sum / 10;
            }
            if (lastR != 0) {
                int sum = num[hugeNum.size] + lastR;
                num[hugeNum.size] = sum % 10;
                num[hugeNum.size + 1] = sum / 10;
                if (hugeNum.size + 1 > size) {
                    size ++;
                }
            }
        }

        public String getNum() {
            StringBuilder ret = new StringBuilder();
            for (int i = size - 1; i >= 0; i--) {
                ret.append(num[i]);
            }
            return ret.toString();
        }
    }

    public static void main(String[] args) {
        // 法一：构造一个大值
//        HugeNum hugeNum = new HugeNum();
//        HugeNum last = new HugeNum();
//        for (int i = 0; i < 64; i++) {
//            if (last.isEmpty()) {
//                last.setOne(1);
//                hugeNum.setOne(1);
//                continue;
//            }
//            last.add(last);
//            hugeNum.add(last);
//        }
//        System.out.println(hugeNum.getNum());

        // 法二：使用Java中的大值
        BigInteger bigInteger = new BigInteger("1");
        BigInteger last = new BigInteger("1");
        for (int i = 1; i < 64; i++) {
            bigInteger = bigInteger.add(last.add(last));
            last = last.add(last);
        }
        System.out.println(bigInteger);
    }

}
